package com.banquetmanagementsystem.mapper;

import com.banquetmanagementsystem.pojo.entity.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author tanghaihua
 */
@Mapper
public interface UserInfoMapper {
    /**
     * 查询所有用户
     *
     * @return 返回全部用户列表
     */
    @Select("SELECT ID, USER_NAME, PASSWORD, NAME, GENDER_ID, TELEPHONE, PRSON_ID, ADDRESS, AUTHOR_ID, USER_DESCRIBE from user_info")
    public List<UserInfo> list();

    /**
     *
     * @param userInfo 用户信息
     */
    @Select("SELECT ID, USER_NAME, PASSWORD, NAME, GENDER_ID, TELEPHONE, PRSON_ID, ADDRESS,AUTHOR_ID, USER_DESCRIBE FROM user_info WHERE user_name = #{username} AND password = #{password}")
    public UserInfo checkUser(UserInfo userInfo);
}
